﻿using System.Collections.Generic;

namespace Isaac.Joy.Menu.Module
{
    /// <summary>
    /// 集合扩展类
    /// </summary>
    public static class EnumerableExtensions
    {
        /// <summary>
        /// 扩展集合添加方法
        /// </summary>
        /// <typeparam name="T">添加对象类型</typeparam>
        /// <param name="e">源集合</param>
        /// <param name="value">目标对象</param>
        /// <returns>结果集合</returns>
        public static IEnumerable<T> Add<T>(this IEnumerable<T> e, T value)
        {
            foreach (var cur in e)
            {
                yield return cur;
            }
            yield return value;
        }
    }
}
